import { Message } from 'element-ui';

function messageFactory(type = 'info') {
  return function (message, options = {}) {
    return Message(Object.assign(options, { type, message }));
  };
}

export const infoMsg = messageFactory();

export const successMsg = messageFactory('success');

export const warningMsg = messageFactory('warning');

export const errorMsg = messageFactory('error');
